// For toolchain compatible
#define TOOL_CHAIN_COMPATIBLE(sym) #sym 

/* For every exported symbol, place a struct in the __ksymtab section */
#define __EXPORT_SYMBOL(sym, sec)				\
	static const char K_strtab_##sym[]			\
	__attribute__((section("K_symtab_strings")))		\
	= TOOL_CHAIN_COMPATIBLE(sym);                    	\
	static const struct KernelSymbol K_symtab_##sym	\
	__attribute_((__used__))				\
	__attribute__((section("K_symtab" sec), unused))	\
	= { (BYTE *)&sym, K_strtab_##sym }

//global symbal whit kernel
struct KernelSymbol
{
	BYTE *value;
	const char *name;
};

#define EXPORT_SYMBOL(sym)			\
		__EXPORT_SYMBOL(sym, "")
		
#define component_init(sym)			\
	static const void *K_component_init	\
	__attribute__((__used__))			\
	__attribute__((section("K_ComponentInitAddr"),unused))	\
	=	&sym
		
#define __init_	__attribute__((section("K_ComponentInit")))

